const { request } = require('../util/request');
const config = require("../util/config");

module.exports = {
    //添加电影信息的相关图片
    addImg: async ({ _id, url }) => {
        var options = {
            method: "PATCH",
            uri: `${config['api_server']}/movies/${_id}/images/${encodeURIComponent(url)}`,
        }
        return await request(options);
    },
    addPoster: async ({ _id, url }) => {
        var options = {
            method: "PATCH",
            uri: `${config['api_server']}/movies/${_id}/poster/${encodeURIComponent(url)}`,
        }
        return await request(options);

    },
    removeImg: async ({ _id, url }) => {
        var options = {
            method: "DELETE",
            uri: `${config['api_server']}/movies/${_id}/images/${encodeURIComponent(url)}`
        };
        return await request(options);
    },
    // addMovies: async ({ url }) => {
    //     var opacity = {
    //         method :"post"
    //     }
    // }
}